<template>
  <div>
    <el-tabs type="card">
      <el-tab-pane lazy>
        <span slot="label">未发货订单 </span>
        <goods-order-table :order-type="1" :status="0" need-ctrl>
          <template slot="ctrl" slot-scope="scope">
            <el-button type="success"
                       plain
                       @click="handlePost(scope.info)"
                       size="small"
            >立即发货
            </el-button>
          </template>
        </goods-order-table>

      </el-tab-pane>
<!--      <el-tab-pane lazy>-->
<!--        <span slot="label"> 已发货订单</span>-->
<!--        <goods-order-table :order-type="1" :status="1"/>-->
<!--      </el-tab-pane>-->
      <el-tab-pane lazy>
        <span slot="label"> 所有商品订单</span>
        <goods-order-table :order-type="1"/>

      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>


import OrderTable from "@/views/commodityManage/components/orderTable";
import GoodsOrderTable from "@/views/commodityManage/components/goodsOrderTable";

export default {
  components: { GoodsOrderTable, OrderTable },
  data () {
    return {};
  },
  mounted () {

  },
  watch: {},
  methods: {
    async handlePost (info) {
      console.log(`info-->`, info);
      const goodOrderId = info.goodOrderId;
      console.log(`orderId-->`, goodOrderId);
      const res = await this.$http.ConfirmGoodsPost({ orderId:goodOrderId });
      if (res.code !== 0) return null;
      this.$router.go(0);
    },
  },

};
</script>
